//
//  JgAdsBannerCustomEvent.m
//  AnyThinkSDKDemo
//
//  Created by Erik on 2021/12/8.
//  Copyright © 2021 抽筋的灯. All rights reserved.
//

#import "JgAdsBannerCustomEvent.h"

@implementation JgAdsBannerCustomEvent

/**
 *  请求广告条数据成功后调用
 *  当接收服务器返回的广告数据成功后调用该函数
 */
- (void)jgadsBannerSuccessLoad:(JgAdsBannerAdView *)jgadsBannerView {
#if DEBUG
    NSLog(@"jgads加载成功：%s",__func__);
#endif
    [self trackBannerAdLoaded:jgadsBannerView adExtra:nil];
}

/**
 *  请求广告条数据失败后调用
 *  当接收服务器返回的广告数据失败后调用该函数
 */
- (void)jgadsBannerViewFailedToLoadWithError:(NSError *)error {
    [self trackBannerAdLoadFailed:error];
}

/**
 *  曝光回调
 */
- (void)jgadsBannerViewWillExpose:(JgAdsBannerAdView *)jgadsBannerView {
    [self trackBannerAdImpression];
}

/**
 *  点击回调
 */
- (void)jgadsBannerViewClicked:(JgAdsBannerAdView *)jgadsBannerView {
    [self trackBannerAdClick];
}

/**
 *  被用户关闭时调用
 */
- (void)jgadsBannerViewWillClose:(JgAdsBannerAdView *)jgadsBannerView {
    [jgadsBannerView removeFromSuperview];
    [self trackBannerAdClosed];
}


- (NSString *)networkUnitId {
    return self.serverInfo[@"slot_id"];
}


@end
